﻿<Window x:Class="DocumentManagement.Views.ReportDocumentINFromDivision"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:vm="clr-namespace:DocumentManagement.ViewsModels"
        Title="ReportDocumentINFromDivision" Height="768" Width="1024" xmlns:my="clr-namespace:DocumentManagement.Converters" Loaded="Window_Loaded">
    <Window.Resources>
        <vm:ReportDocumentINFromDivisionViewsModel x:Key="reportDocumentINFromDivisionViewsModel"/>
        <my:DateConverter x:Key="dateConverter" />
        <my:TextSpeedConverter x:Key="textSpeedConverter" />
        <my:TextActionConverter x:Key="textActionConverter" />
        <my:TextStatusConverter x:Key="textStatusConverter" />
    </Window.Resources>
        <Grid  Margin="10,10,12,29" DataContext="{Binding Source={StaticResource reportDocumentINFromDivisionViewsModel}}">
            <Grid.RowDefinitions>
                <RowDefinition Height="35" />
                <RowDefinition Height="30" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <StackPanel Height="35" Name="stackPanel2" Orientation="Vertical" VerticalAlignment="Center">
                <TextBlock FontFamily="Tahoma" FontSize="16" FontWeight="Bold" Height="23" Margin="0,5,0,0" Name="textBlock2" Text="รายงานหนังสือเข้าจากหน่วยงาน" TextAlignment="Center" VerticalAlignment="Center" Width="249" />
            </StackPanel>
            <DataGrid AlternatingRowBackground="#FFCCF5F0" AutoGenerateColumns="False" CanUserReorderColumns="True" CanUserResizeColumns="True" CanUserResizeRows="True" CanUserSortColumns="True" FontFamily="Tahoma" FontSize="14" FontWeight="Normal" Grid.Row="2" IsManipulationEnabled="False" IsReadOnly="True" ItemsSource="{Binding Path=MyReceiveICV, Mode=TwoWay}" Margin="0,5,0,0" Name="ShowReceiveDataGrid">
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=ReceiveID, Mode=TwoWay}" Header="รหัส" />
                    <DataGridTextColumn Binding="{Binding Path=ReceiveCode, Mode=TwoWay}" Header="รหัสรับหนังสือ" />
                    <DataGridTextColumn Binding="{Binding Path=ReceiveDate, Mode=TwoWay, Converter={StaticResource dateConverter}, StringFormat=\{0:d\}}" Header="วันที่รับหนังสือ" />
                    <DataGridTextColumn Binding="{Binding Path=DocumentDate, Mode=TwoWay, Converter={StaticResource dateConverter}, StringFormat=\{0:d\}}" Header="วันที่ในหนังสือ" />
                    <DataGridTextColumn Binding="{Binding Path=DocumentCode, Mode=TwoWay}" Header="เลขที่ในหนังสือรับ" />
                    <DataGridTextColumn Binding="{Binding Path=Division_FromDivision.ThaiName, Mode=TwoWay}" Header="จากหน่วยงาน" />
                    <DataGridTextColumn Binding="{Binding Path=Division_ToDivision.ThaiName, Mode=TwoWay}" Header="ถึงหน่วยงาน" />
                    <DataGridTextColumn Binding="{Binding Path=Title, Mode=TwoWay}" Header="ชื่อเรื่อง" />
                    <DataGridTextColumn Binding="{Binding Path=Speed, Mode=TwoWay, Converter={StaticResource textSpeedConverter}}" Header="ชั้นความเร็ว" />
                    <DataGridTextColumn Binding="{Binding Path=Action, Mode=TwoWay, Converter={StaticResource textActionConverter}}" Header="การปฏิบัติ" />
                    <DataGridTextColumn Binding="{Binding Path=Description, Mode=TwoWay}" Header="หมายเหตุ" />
                    <DataGridTextColumn Binding="{Binding Path=Status, Mode=TwoWay, Converter={StaticResource textStatusConverter}}" Header="ชนิดหนังสือ" />
                    <DataGridTextColumn Binding="{Binding Path=LogID, Mode=TwoWay}" Header="ผู้บันทึกรายการ" />
                </DataGrid.Columns>
            </DataGrid>
            <StackPanel Grid.Row="1" Name="stackPanel1" Orientation="Horizontal">
                <TextBlock FontFamily="Tahoma" FontSize="14" FontWeight="Normal" Height="23" Name="textBlock4" Text="จำนวนหนังสือเข้าจากหน่วยงาน :" TextAlignment="Right" Width="180" />
                <TextBlock FontFamily="Tahoma" FontSize="14" FontWeight="Normal" Height="28" Name="ReceiveCodeOrTitleTextBox" Text="{Binding Path=MyText1, Mode=TwoWay}" TextAlignment="Center" Width="123" />
                <TextBlock FontFamily="Tahoma" FontSize="14" FontWeight="Normal" Height="23" Name="textBlock5" Text="ชุด" TextAlignment="Right" Width="19" />
                <TextBlock FontFamily="Tahoma" FontSize="14" FontWeight="Normal" Height="23" Name="textBlock1" Text="หนังสือภายนอกจำนวน :" TextAlignment="Right" Width="150" />
                <TextBlock FontFamily="Tahoma" FontSize="14" FontWeight="Normal" Height="28" Name="textBox1" Text="{Binding Path=MyText2, Mode=TwoWay}" TextAlignment="Center" Width="64" />
                <TextBlock FontFamily="Tahoma" FontSize="14" FontWeight="Normal" Height="23" Name="textBlock6" Text="ชุด" TextAlignment="Right" Width="19" />
                <TextBlock FontFamily="Tahoma" FontSize="14" FontWeight="Normal" Height="23" Name="textBlock3" Text="หนังสือภายในจำนวน :" TextAlignment="Right" Width="150" />
                <TextBlock FontFamily="Tahoma" FontSize="14" FontWeight="Normal" Height="28" Name="textBox2" Text="{Binding Path=MyText3, Mode=TwoWay}" TextAlignment="Center" Width="63" />
                <TextBlock FontFamily="Tahoma" FontSize="14" FontWeight="Normal" Height="23" Name="textBlock7" Text="ชุด" TextAlignment="Right" Width="19" />
        </StackPanel>
        </Grid>
   
</Window>
